Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Microsoft.​Extensions.​Options.​IOptionsMonitorCache<​TOptions>

Assembly: Microsoft.Extensions.Options

Used by <see cref="T:Microsoft.Extensions.Options.IOptionsMonitor`1" /> to cache <typeparamref name="TOptions" /> instances.

Methods

void
Clear​()
Clears all options instances from the cache.
TOptions
GetOrAdd​(string name, System.​Func<​TOptions> createOptions)
Gets a named options instance, or adds a new instance created with <paramref name="createOptions" /> .
Returns The options instance.
name The name of the options instance.
createOptions The func used to create the new instance.
bool
TryAdd​(string name, TOptions options)
Tries to adds a new option to the cache.
Returns <see langword="true" /> if the options instance was added; <see langword="false" /> if the name already exists.
name The name of the options instance.
options The options instance.
bool
TryRemove​(string name)
Tries to remove an options instance.
Returns <see langword="true" /> if the options instance was removed; otherwise, <see langword="false" /> .
name The name of the options instance.